package com.irs.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.irs.pojo.User;
import com.irs.service.UUserice;
import com.irs.service.UUserservices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    private UUserservices uUserservices;
    @RequestMapping("caigou/shop")
    public String selectEmpList(@RequestParam(value="pn",defaultValue="1")int pn, Model model) {
        PageHelper.startPage(pn,5);
        List<User> emplist=uUserservices.select();
        //使用pageinfo包装查询后的结果，只需要将pageinfo交给页面,传入连续显示的页数
        PageInfo page=new PageInfo(emplist,3);
        model.addAttribute("pageInfo",page);
        return "page/caigou/goodsList";
    }



}
